//
//  Player.hpp
//  dot
//
//  Created by zz on 2019/6/16.
//

#ifndef Player_hpp
#define Player_hpp

#include <stdio.h>
#include "cocos2d.h"
using namespace cocos2d;

class Player : public Sprite{
  
private:
    Vec2 _pos;
public:
    
    static Player* create(Vec2 pos);
    bool init(Vec2 pos);
    void changeDir();  //改变方向
    void changeAnPoint(); //改变锚点
    void createRound();//创建旋转运动
    Vec2 getActionPoint();
    float getR();

private:
    Sprite* p1;
    Sprite* p2;
    Vec2 po1; //记录锚点1
    Vec2 po2;//记录锚点2
    bool currentAnp;  //记录当前锚点
    int currentDir;   //记录当前旋转方向
    float speed;    //旋转速度
    float r;
public:
    void addSpeed(float v);
};


#endif /* Player_hpp */
